// pages/rec_list/index.js
const { $http } = getApp()
const hoseTypeData = ['两室','三室','四室','五室及以上']
const orientData = ['东户','西户','东中','西中']
const specialData = [
    { label:'优质学区' }, { label:'生活便利' }, { label:'南北通透' }, { label:'车位充足' }, { label:'绿化率高' },
    { label:'不要顶层' }, { label:'一梯一户' }, { label:'优质物业' }, { label:'带电梯' }, { label:'高楼层' },
    { label:'中间楼层' }, { label:'采光好' }, { label:'楼间距大' }, { label:'智能社区' }, { label:'公园旁' },
]
Page({
    data: {
        formData: [
            { label:'姓名', name:'name', r:1, maxLen:4 },
            { label:'电话', name:'phone', r:1  },
            { label:'您首付预算是多少？', name:'budget', opt:{ p:'请输入预算' }, endText:'万', },
            { label:'您想买什么户型？', name:'house_type', type:'radio', str:true, data:hoseTypeData},
            { label:'您想买什么朝向？', name:'orient', type:'radio', str:true, data:orientData},
            { label:'其它特殊要求', name:'special', type:'checkbox-group', str:true, count:3,  idStr:'label', data:specialData},
            { label:'备注', name:'mark', type:'textarea'},
        ],
    },
    onSubmit({ detail }){
        $http.post(this,'invest', {
            param:detail,
            okText: '提交成功',
            back: true
        })
    }
})